﻿#include "widget.h"

#include <QApplication>
#include <QDebug>
#include <QFontDatabase>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    int font_Id = QFontDatabase::addApplicationFont(":/fonts/D-DINEXP.TTF");  //":/冒号表示资源根目录
    QStringList font_list = QFontDatabase::applicationFontFamilies(font_Id);
    if(!font_list.isEmpty())
    {
        QFont f;
        f.setFamily(font_list[0]);
        a.setFont(f);  //a 为用户需要修改的地方，比如 lineEdit
    }

    QFile qss(":/index.qss");
    if(qss.open(QFile::ReadOnly))
    {
        QByteArray ss = qss.readAll();
        qDebug() << ss;
        a.setStyleSheet(ss);
        qss.close();
    }


    Widget w;
    w.show();   

    return a.exec();
}
